@extends('extend.admin')
@section('title','评价编辑')
@section('content')
<section id="main-content"> 
   <div class="row"> 
    <div class="col-md-12"> 
     <!--breadcrumbs start --> 
     <ul class="breadcrumb"> 
      <li><a href="#">首页</a> </li> 
      <li>评价管理</li> 
      <li class="active">评价列表</li> 
     </ul> 
     <!--breadcrumbs end --> 
     <h1 class="h1">评价列表</h1> 
    </div> 
   </div> 
   <div class="row"> 
    <div class="col-md-12"> 
     <div class="panel panel-default"> 
      <div class="panel-heading"> 
       <h3 class="panel-title">评价列表</h3> 
       <div class="actions pull-right"> 
        <i class="fa fa-chevron-down"></i> 
        <i class="fa fa-times"></i> 
       </div> 
      </div> 
      <div class="panel-body"> 
       <div role="grid" id="example_wrapper" class="dataTables_wrapper form-inline no-footer">
        <div class="row">
        <form action="/comment/list">
             <div class="col-xs-6">
              <div class="dataTables_length" id="example_length">
               <label>每页显示
                   <select name="num" aria-controls="example" class="form-control input-xs">
                       <option value="10" @if($request->input('num') ==10) selected @endif>10</option>
                       <option value="25" @if($request->input('num') ==25) selected @endif>25</option>
                       <option value="50" @if($request->input('num') ==50) selected @endif>50</option>
                       <option value="100" @if($request->input('num') ==100) selected @endif>100</option>
                   </select>
               条</label>
              </div>
             </div>
             <div class="col-xs-6">
              <div id="example_filter" class="dataTables_filter">
               <label class="pull-right">关键字:<input name="keyword" value="{{$request->input('keyword')}}" class="form-control input-sm" aria-controls="example" type="search" /><button type="submit" class="btn btn-primary">查询</button></label>
              </div> 
             </div>
         </form>
        </div>
        <table id="example" class="table table-striped table-bordered dataTable no-footer" aria-describedby="example_info" style="width: 100%;" width="100%" cellspacing="0"> 
         <thead> 
          <tr role="row">
           <th class="sorting text-center" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 100px;" aria-sort="ascending" aria-label="Name: activate to sort column ascending">商品ID</th>
           <th class="sorting text-center" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 108px;" aria-label="Position: activate to sort column ascending">商品名称</th>
           <th class="sorting text-center" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 124px;" aria-label="Office: activate to sort column ascending">商品评价</th>
           <th class="sorting text-center" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 174px;" aria-label="Salary: activate to sort column ascending">操作</th>
          </tr> 
         </thead> 
         <tbody>
         @foreach($comments as $k=>$v) 
          <tr class="odd"> 
           <td class="sorting_1 text-center">{{$v->id}}</td> 
           <td>{{$v->name}}</td> 
           <td>{{$v->comment}}</td> 
           <td class="text-center"><a href="/comment/edit?id={{$v->id}}">修改</a>&nbsp;<span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;&nbsp;&nbsp;<a class="que" href="/comment/drop?id={{$v->id}}">删除</a>&nbsp;<span class="glyphicon glyphicon-list-alt"></span></td> 
          </tr>
          @endforeach
         </tbody> 
        </table>
        <script type="text/javascript">
          var asd=document.getElementsByClassName('que');
          for(var i=0;i<asd.length;i++){
            asd[i].onclick=function(){
              var type=confirm("此操作不可逆转,你确信要删除?")
              if(!type){
                return false;
              }else{
                return true;
              }
            }
          }
        </script>
        <div class="row">
         <div class="col-xs-6">
          <!-- <div class="dataTables_info" id="example_info" role="alert" aria-live="polite" aria-relevant="all">
           Showing 1 to 10 of 57 entries
          </div> -->
         </div>
         <div class="col-xs-6">
          <div class="dataTables_paginate paging_simple_numbers" id="example_paginate">
               {!! $comments->appends($request->only(['num','keyword']))->render() !!}
          </div>
         </div>
        </div>
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
  </section>
@endsection